package com.zxc.Test;

import org.apache.shiro.crypto.hash.SimpleHash;
import org.apache.shiro.util.ByteSource;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.UUID;

public class UTest {
    public static void main(String[] args) {
////        生成uuid
//        for (int i = 0; i <20 ; i++) {
//            String Uuid = UUID.randomUUID().toString().replaceAll("-", "");
//            System.out.println(Uuid);
//        }

// 密码生成器
        String hashAlgorithnName="MD5";
        Object credentials = "user";
        Object salt = ByteSource.Util.bytes("user");
        int hashIterations = 1;

        Object result = new SimpleHash(hashAlgorithnName,credentials,salt,hashIterations);
        System.out.println(result);
        System.out.println(result.toString());

//    生成当前时间
//        Date d = new Date();
//        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
//        System.out.println(sdf.format(d));

    }
}
